#ifndef PROCESSSLAVE_H
#define PROCESSSLAVE_H

//LIBRERIE OPENCV
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

//LIBRERIE QT
#include <QtGui>

//LIBRERIE IMAGELAB
#include "ptz_controller.h"
#include "proclib_SourceManager.h"
#include <imglib_ImageRGB.h>
#include <opencvsupport.h>

#include "utility.h"

#include "processmaster.h"
typedef     vector<QPoint> (*FunctionSlave)(CImageRGB* frame);
class ProcessSlave: public QObject
{
    Q_OBJECT

    QMutex _useList;

    PTZ_Controller *_Slave;
    CSourceManager *_frameManager;

    std::vector<PointTime> _scanPoint;

    bool _GoRoutine;

     vector<QPoint> _foundPoint;

    ProcessMaster *_procMaster;

    FunctionSlave _internalFunction;

public:
    ProcessSlave(PTZ_Controller *Slave,CSourceManager *frameManger, ProcessMaster *procMaster, FunctionSlave internalFunction);

public slots:
    void sl_UpdatePoint(vector<PointTime> *foundPoint);
    void sl_consume();
    void sl_ExecRoutine(CImageRGB *frame);
    void sl_GoExecRoutine();

signals:
    void sign_finishedUpload();
    void sign_NoMove();
    void sign_finishedMove();
    void sign_finishedRoutine(vector<QPoint>*);
    void sign_finishedRoutine(CImageRGB*);

};

#endif // PROCESSSLAVE_H


